﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LG.Common
{
    internal class StringCommon
    {
        /// <summary>
        /// 邮箱正则表达式
        /// </summary>
        public static readonly string RegEmail = "^[-_A-Za-z0-9]+@([_A-Za-z0-9]+.)+[A-Za-z0-9]{2,3}$";
        public static readonly string RegEmailNoEnds = "[-_A-Za-z0-9]+@([_A-Za-z0-9]+.)+[A-Za-z0-9]{2,3}";

        /// <summary>
        /// 固话号正则表达式
        /// </summary>
        public static readonly string RegTelephone = "^(0[0-9]{2,3}-)?([2-9][0-9]{6,7})+(-[0-9]{1,4})?$";
        public static readonly string RegTelephoneNoEnds = "(0[0-9]{2,3}-)?([2-9][0-9]{6,7})+(-[0-9]{1,4})?";

        /// <summary>
        /// 手机号正则表达式
        /// </summary>
        public static readonly string RegCellphone = "^1[3,5,8]{1}[0-9]{1}[0-9]{8}$";
        public static readonly string RegCellphoneNoEnds = "1[3,5,8]{1}[0-9]{1}[0-9]{8}";

        /// <summary>
        /// 作为js字符串前处理表达式
        /// </summary>
        public static readonly string RegJSString = "['\"\\\n\r\t]{1}";
    }
}
